import service from "./request";
export default {
  //登录
  login(data, headers) {
    return service({
      url: "/api/user/login",
      method: "post",
      headers,
      data,
    });
  },
  getScreenList(data, headers) {
    return service({
      url: "/screen/queryPage",
      method: "post",
      headers,
      data,
    });
  },
  getAllScreen() {
    return service({
      url: "/screen/getAllScreen",
      method: "get",
    });
  },
  addScreen(data, headers) {
    // 新增大屏
    return service({
      url: "/screen/add",
      method: "post",
      headers,
      data,
    });
  },
  updScreen(data, headers) {
    // 修改大屏
    return service({
      url: "/screen/upd",
      method: "post",
      headers,
      data,
    });
  },
  delScreen(data) {
    // 删除大屏
    return service({
      url: `/screen/del/${data.id}`,
      method: "get",
    });
  },
  getTenantList(data, headers) {
    return service({
      url: "/tenant",
      method: "post",
      headers,
      data,
    });
  },
  addTenant(data, headers) {
    // 新增租户
    return service({
      url: "/tenant/add",
      method: "post",
      headers,
      data,
    });
  },
  updTenant(data, headers) {
    // 修改租户
    return service({
      url: "/tenant/upd",
      method: "post",
      headers,
      data,
    });
  },
  editState(data, headers) {
    // 修改租户
    return service({
      url: "/tenant/editState",
      method: "post",
      headers,
      data,
    });
  },
  getTenant(data) {
    // 获取租户信息
    return service({
      url: `/tenant/${data.id}`,
      method: "get",
    });
  },
  delTenant(data) {
    // 删除租户
    return service({
      url: `/tenant/${data.id}`,
      method: "delete",
    });
  },

  uploadFile(data, headers) {
    // 上传文件
    return service({
      url: "/tenant/upd",
      method: "post",
      headers,
      data,
    });
  },
};
